<?php

class ProfilController extends Controller
{
	public function actionIndex()
	{
		$idTravel = $_GET['idTravel'];
		$idDetailTravel = $_GET['idDetailTravel'];
		
		$sqlPenyediaTravel = "SELECT ID_TRAVEL, NAMA_TRAVEL, EMAIL, TELEPON_TRAVEL, DESKRIPSI_TRAVEL 
								FROM penyedia_travel 
								WHERE ID_TRAVEL = " . $idTravel;
		$sqlLayanan = "SELECT NAMA_LAYANAN, DESKRIPSI_LAYANAN 
						FROM layanan_travel
						WHERE ID_TRAVEL = " . $idTravel;
		$sqlFasilitas = "SELECT NAMA_FASILITAS, DESKRIPSI_FASILITAS 
						FROM `fasilitas_travel` 
						WHERE ID_TRAVEL = " . $idTravel;
						
		$penyediaTravels = Yii::app()->db->createCommand($sqlPenyediaTravel)->queryAll();
		$layanans = Yii::app()->db->createCommand($sqlLayanan)->queryAll();
		$fasilitass = Yii::app()->db->createCommand($sqlFasilitas)->queryAll();
		
		$this->render('index', array('PenyediaTravels' => $penyediaTravels,
									 'Layanans' => $layanans,
									 'Fasilitass' => $fasilitass,
									 'jmlLayanan' => count($layanans),
									 'jmlFasilitas' => count($fasilitass)					 
									));
	}

	// Uncomment the following methods and override them if needed
	/*
	public function filters()
	{
		// return the filter configuration for this controller, e.g.:
		return array(
			'inlineFilterName',
			array(
				'class'=>'path.to.FilterClass',
				'propertyName'=>'propertyValue',
			),
		);
	}

	public function actions()
	{
		// return external action classes, e.g.:
		return array(
			'action1'=>'path.to.ActionClass',
			'action2'=>array(
				'class'=>'path.to.AnotherActionClass',
				'propertyName'=>'propertyValue',
			),
		);
	}
	*/
}?>